package com.wasion.pwportable.protocol.analyzer.indicator;

import com.wasion.pwportable.protocol.analyzer.AbstractAnalyzer;

/**
 * 
* @ClassName: NEIGHBOR_INFO_RD_Analyzer 
* @Description: 6E. 节点相邻属性信息（用于组网） 
* @author 高意 
* @date 2014-9-11 上午8:33:57 
*
 */
public class NEIGHBOR_INFO_RD_Analyzer extends AbstractAnalyzer {

	@Override
	public void dataAnalysis(String ackBS) {

		String data = ackBS.substring(DATABITSTART, DATABITSTART + 14);

		String devIdD = data.substring(4, 6) + data.substring(2, 4)
				+ data.substring(0, 2);
		result.setNeighbor1(devIdD);

		devIdD = data.substring(10, 12) + data.substring(8, 10)
				+ data.substring(6, 8);
		result.setNeighbor2(devIdD);

		String phase = data.substring(12, 13);
		result.setPhase(phase);
		// if(phase.equals("1")){
		// result.setPhase("A");
		// }
		// else if (phase.equals("2")){
		// result.setPhase("B");
		// }
		// else{
		// result.setPhase("C");
		// }

		int branchId = Integer.parseInt(data.substring(13, 14), 16);
		result.setBrachId(branchId);
	}
}
